package com.terranovita.gaming.pulpgui.skin;

import pulpcore.image.CoreImage;

/**
 * The skin manager is in charge of the graphics for the GUI elements. It will
 * return the correct CoreImage depending on the requested file and currently
 * active skin
 * 
 * @author fvantom
 * 
 */
public class SkinManager
{
	// singleton pattern
	private static SkinManager instance = new SkinManager();

	private SkinManager()
	{

	}

	public static SkinManager getInstance()
	{
		return instance;
	}

	// class variables
	private String skinName = "default";

	private String skinLocation = "gui/";

	private String skinExtention = ".png";

	public String getSkinName()
	{
		return skinName;
	}

	public void setSkinName(String skinName)
	{
		this.skinName = skinName;
	}

	public CoreImage getImage(String name)
	{
		StringBuilder builder = new StringBuilder(128);
		builder.append(skinLocation);
		builder.append(skinName);
		builder.append("/");
		builder.append(name);
		builder.append(skinExtention);
		return CoreImage.load(builder.toString());
	}

}
